package com.slx.sthq.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.slx.sthq.common.page.PageQuery;
import com.slx.sthq.common.page.TableDataInfo;
import com.slx.sthq.domain.Wjlb;
import com.slx.sthq.domain.dto.CommonPersonDto;
import com.slx.sthq.domain.qo.SearchQo;
import com.slx.sthq.mapper.ZfwCommonPersonMapper;
import com.slx.sthq.service.ZfwSearchService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;


@Service
public class ZfwSearchServiceImpl implements ZfwSearchService {


    @Resource
    private ZfwCommonPersonMapper zfwCommonPersonMapper;


    @Override
    public TableDataInfo<Wjlb> queryPageList(SearchQo qo, PageQuery pageQuery) {


        LambdaQueryWrapper<Wjlb> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.like(StringUtils.isNoneBlank(qo.getCaseName()), Wjlb::getMc, qo.getCaseName());


        Page<Wjlb> page = zfwCommonPersonMapper.selectPage(pageQuery.build(), lambdaQueryWrapper);

        return TableDataInfo.build(page);
    }


}
